<div class="mid-nav shadow-div heighten">
    <div class="row">
        <div class="col-md-offset-1 col-md-10" style="margin-top:20px;">
            <div ng-if="!orders || orders.length==0">
                <div class="out-container">
                    <div class="boo-wrapper">
                        <div class="boo">
                            <div class="face"></div>
                        </div>
                        <div class="shadow"></div>
                        <h1><font color="#C0C0C0">没有任何订单</font></h1>
                    </div>
                </div>
            </div>
            <div ng-if="orders">
                <table class="table-condensed" ng-repeat="order in orders">
                    <tr class="{{order.tClass}}">
                        <td class="item-1-3 text-center">{{order.merchant.mBrand}}</td>
                        <td class="item-1-3 text-center">{{order.date_msg}}</td>
                        <td class="item-1-3 text-center">{{order.status_msg}}</td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <ul class="list-group">
                                <div ng-repeat="food in order.foodInfo">
                                    <li class="list-group-item">
                                        <div class="media">
                                            <div class="media-left">
                                                <a href="javascript:void(0);">
                                                    <img class="img-responsive img-thumbnail media-object"
                                                         src="{{imgPath}}{{food.item.fViewPath}}" alt="placeholder" width="100"
                                                         height="100">
                                                </a>
                                            </div>
                                            <div class="media-body">
                                                <h4 class="media-heading">{{food.item.fName}}</h4>
                                                <h4 class="pull-left">x {{food.num}}</h4>
                                                <h4 class="pull-right">{{food.item.fPrice}}元</h4>
                                            </div>
                                        </div>
                                    </li>
                                </div>

                            </ul>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="1" class="text-left">
                            <div ng-if="order.oStatus == 3 && (order.complaint == null || order.complaint == '')">
                                <button type="button" class="btn btn-primary btn-sm" data-toggle="modal"
                                        data-target="#evalution_modal" ng-click="setCurrent($index)">
                                    投诉
                                </button>
                            </div>
                            <div ng-if="order.oStatus == 2">
                                <button type="button" class="btn btn-danger btn-sm" data-toggle="modal"
                                        data-target="#confirm_modal" ng-click="setCurrent($index)">
                                    确认收货
                                </button>
                            </div>
                        </td>
                        <td colspan="2" class="text-right" name="total">
                            总价：{{order.sum}}元
                        </td>
                    </tr>
                </table>
                <hr>
            </div>

        </div>
    </div>
</div>
</div>


<!-- 投诉模态框 -->
<div class="modal fade" id="evalution_modal" tabindex="-1" role="dialog" aria-labelledby="evalution-title">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header gold-bg">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="evalution-title">投诉</h4>
            </div>
            <div class="modal-body">
                <textarea class="form-control" rows="3" style="resize:none;" placeholder="投诉建议"
                          ng-model="currentOrder.complaintContext"></textarea>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-common btn-block" ng-click="complaint()">提交</button>
                <button type="button" class="btn btn-default btn-block" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>


<!-- 确认收货模态框 -->
<div class="modal fade" id="confirm_modal" tabindex="-1" role="dialog" aria-labelledby="confirm-title">
    <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
            <div class="modal-header gold-bg">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="confirm-title">确认收货</h4>
            </div>
            <div class="modal-body">
                <span name="score">
                    <span id="score">10</span> / 10分
                </span>
                <span class="ratyli" data-rate="10" data-ratemax="10"></span>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-common btn-block" ng-click="confirm()">确认</button>
                <button type="button" class="btn btn-default btn-block" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>

